package org.particlethink.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.particlethink.dto.BillStatusAndCount;
import org.particlethink.entry.BillStatus;
import org.particlethink.model.Bill;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Mapper
public interface BillMapper extends tk.mybatis.mapper.common.Mapper<Bill> {
    List<Bill> queryNo(@Param("no") String no, @Param("status") BillStatus status);


    List<Bill> queryBills(
            @Param("projectIds") List<Integer> projectIds,
            @Param("supplierIds") List<Integer> supplierIds,
            @Param("creatorIds") List<Integer> creatorIds,
            @Param("status") BillStatus status,
            @Param("billDate") Date billDate,
            @Param("createStart") Date createStart,
            @Param("createEnd") Date createEnd
    );

    List<Bill> queryBillsWithIds(
            @Param("ids") List<Integer> ids
    );

    List<BillStatusAndCount> countByStatus(@Param("supplierIds") List<Integer> supplierIds, @Param("projectIds") List<Integer> projectIds, @Param("statuses") List<BillStatus> statuses);
}
